# -*- coding:utf-8 -*-
#
# 项目: pysnake
# 文件: aplle.py
# 功能: define class Apple
# 许可: General Public License
# 作者: Zhao Xin (赵鑫) <pythonchallenge@qq.com>
# 时间: 2016.07.24

from random import randint

from mygame.settings import *


class Apple:
    """苹果类"""

    @staticmethod
    def gen(snake) -> tuple[int, int]:
        while True:
            p = randint(0, COLUMNS - 1), randint(0, ROWS - 1)
            if p not in snake:
                return p

    @staticmethod
    def shape(p):
        return p, CELL_SIZE, APPLE_COLOR_SKIN, APPLE_COLOR_BODY
